const sql = require('../mysql/config');
module.exports = async (req,res)=>{
    var username = req.body.username;
    var data = await sql(`select nickname,avatar from user where username =  "${username}"`);
    console.log(data);
    res.send({
        code:200,
        avatar:data[0].avatar,
        nickname:data[0].nickname
    })
}